package com.yourname.menu;

import com.yourname.action.CourseAction;
import com.yourname.action.LoginAction;
import com.yourname.action.ScoreAction;
import com.yourname.entity.CourseStudent;

import java.util.Scanner;

public class CourseManageMenu {
    public static void courseMenu(String loginTag){
        while (true){
        StringBuilder menuStrBuilder=new StringBuilder();
        if(loginTag.equals("teacher")){
            menuStrBuilder.append("1.创建课程\n")
                    .append("2. 编辑课程\n");
        }else if (loginTag.equals("student")) {
            menuStrBuilder.append("3. 选课\n");
            menuStrBuilder.append("4. 查看选课\n");
            menuStrBuilder.append("5. 退课\n");
        }
        menuStrBuilder.append("6. 返回上一级\n");

        System.out.println(menuStrBuilder);
        Scanner scanner=new Scanner(System.in);

            int i = scanner.nextInt();
            switch (i){
                case 1-> CourseAction.createCourse();
                case 2-> CourseAction.editCourse();
                case 3-> CourseAction.chooseCourse(LoginAction.getCurrent());
                case 4-> CourseAction.getCourseList(LoginAction.getCurrent());
                case 5-> CourseAction.quitCourse(LoginAction.getCurrent());
            }
            if (i==6)
                break;
        }

    }
}
